function a(a, e, t) {
    return e in a ? Object.defineProperty(a, e, {
        value: t,
        enumerable: !0,
        configurable: !0,
        writable: !0
    }) : a[e] = t, a;
}

var e, t = require("../../../utils/function.js"), i = require("../../../config.js"), n = getApp(), o = require("../../../api.js");

Page((e = {
    data: {
        imgs: t.userImg,
        img: t.driverImg,
        TodayIncome: 0,
        Spending: 0,
        Income: 0,
        Refund: 0,
        balance: 0,
        actions: i.extract,
        cancelText: "取消",
        page: 1,
        list: [],
        pageSize: 20,
        start_time: "",
        hasMoreData: !0,
        distribution: 1
    },
    intoPageHandler: function(a) {
        t.intoPageHandler(a.currentTarget.dataset.skip);
    },
    openActionsheet: function() {
        this.setData({
            show: !0
        });
    },
    bindTimeChange: function(a) {
        var e = this;
        e.setData({
            page: 1,
            start_time: a.detail.value
        }), e.get_info_list();
    },
    onLoad: function(a) {
        console.log("提现", a), a.uid && n.shareCouponsMessage(a.uid);
    },
    onReady: function() {},
    onShow: function() {
        this.get_info_list();
    },
    toDetail: function(a) {
        console.log(a);
        var e = a.currentTarget.dataset.id;
        wx.navigateTo({
            url: "/pages/driver/walletDetail/walletDetail?id=" + e
        });
    },
    get_info_list: function() {
        var e = this;
        n.request({
            url: o.wallet_log.index,
            method: "post",
            data: {
                page: e.data.page,
                start_time: e.data.start_time
            },
            success: function(t) {
                console.log(t), console.log(t.code);
                var i = e.data.list;
                if (1 == t.code) {
                    var n;
                    e.setData((n = {
                        TodayIncome: t.data.user.TodayIncome
                    }, a(n, "TodayIncome", t.data.user.TodayIncome), a(n, "Spending", t.data.conclusion.Spending), 
                    a(n, "Income", t.data.conclusion.Income), a(n, "Refund", t.data.conclusion.Refund), 
                    a(n, "balance", t.data.user.price), n)), 1 == e.data.page && (i = []);
                    var o = t.data.wallet.data;
                    o.length < e.data.pageSize ? e.setData({
                        list: i.concat(o),
                        hasMoreData: !1
                    }) : e.setData({
                        list: i.concat(o),
                        page: e.data.page + 1,
                        hasMoreData: !0
                    });
                } else wx.showToast({
                    title: "暂无数据",
                    duration: 1e3
                });
            }
        });
    }
}, a(e, "openActionsheet", function() {
    this.setData({
        show: !0
    });
}), a(e, "closeActionSheet", function() {
    this.setData({
        show: !1
    });
}), a(e, "clickAction", function(e) {
    var t, i = this, n = e.detail, o = this;
    o.setData({
        page: 1
    });
    var s = n.index;
    switch (this.setData((t = {}, a(t, "actions[" + s + "].loading", !0), a(t, "actionType", s), 
    t)), s) {
      case 0:
        wx.navigateTo({
            url: "/pages/driver/withdraw-money/index?type=1&&yue=" + o.data.balance + "&&distribution=" + o.data.distribution
        });
        break;

      case 1:
        wx.navigateTo({
            url: "/pages/driver/withdraw-ali/index?type=2&&yue=" + o.data.balance + "&&distribution=" + o.data.distribution
        });
        break;

      case 2:
        wx.navigateTo({
            url: "/pages/driver/withdraw-wechat/index?type=0&&yue=" + o.data.balance + "&&distribution=" + o.data.distribution
        });
    }
    setTimeout(function() {
        var e;
        i.setData((e = {}, a(e, "show", !1), a(e, "actions[" + s + "].loading", !1), e));
    }, 100);
}), a(e, "onReachBottom", function(a) {
    this.data.hasMoreData ? this.get_info_list() : wx.showToast({
        title: "没有更多数据",
        duration: 1e3,
        icon: "none"
    });
}), a(e, "onShareAppMessage", function(a) {
    var e = n.shareAppMessage().title, t = n.shareAppMessage().imageUrl, i = n.shareAppMessage().desc, o = n.shareAppMessage().path;
    return console.log(n.shareAppMessage()), {
        title: e,
        imageUrl: t,
        desc: i,
        path: o
    };
}), e));